import store from "@/store";

console.log(store);

// form
// 默认表单对象
export const defaultForm = {};

// 表单项配置
export const formBase = [
  {
    label: "仓库名字",
    type: "input",
    field: "warehouseName",
    required: true,
  },
  {
    label: "目的地",
    type: "select",
    field: "destinationId",
    required: true,
    optionsKey: "destinationName",
    optionsValue: "id",
    options: store.state.custom_dict.destination,
  },
  {
    label: "联系手机",
    type: "input",
    field: "contactPhone",
    required: true,
  },
  {
    label: "联系人",
    type: "input",
    field: "contactName",
    required: true,
  },
  {
    label: "仓库地址",
    type: "input",
    field: "warehouseAddress",
    required: true,
  },
];

export const formItemStyle = {
  paddingLeft: "20px",
};

// table
// 单元格样式
export const cellStyle = {
  background: "rgba(28, 155, 252, 0.02)",
  color: "rgb(142, 155, 185)",
  textAlign: "center",
};

// 表头单元格样式
export const headerCellStyle = {
  background: "rgba(28, 155, 252, 0.02)",
  color: "rgb(142, 155, 185)",
  textAlign: "center",
};

// 表格内表单子样式
export const tableFormStyle = {
  marginBottom: 0,
};

// 表格项配置
export const tableBase = [
  {
    label: "仓库ID",
    prop: "id",
  },
  {
    label: "简易码",
    prop: "easyCode",
    operate: {
      type: "input",
      field: "easyCode",
    },
  },
  {
    label: "仓库名字",
    prop: "warehouseName",
    width: 150,
    operate: {
      type: "input",
      field: "warehouseName",
    },
  },
  {
    label: "目的地",
    prop: "destinationName",
    width: 200,
    operate: {
      type: "select",
      field: "destinationId",
      optionsKey: "destinationName",
      optionsValue: "id",
      options: store.state.custom_dict.destination,
    },
  },
  {
    label: "仓库类型",
    prop: "warehouseTypeName",
    operate: {
      type: "select",
      field: "warehouseTypeId",
      optionsKey: "warehouseTypeName",
      optionsValue: "id",
      options: [],
    },
  },
  {
    label: "联系电话",
    prop: "contactPhone",
    width: 200,
    operate: {
      type: "input",
      field: "contactPhone",
    },
  },
  {
    label: "联系人",
    prop: "contactName",
    width: 100,
    operate: {
      type: "input",
      field: "contactName",
    },
  },
  {
    label: "邮编",
    prop: "postalCode",
    operate: {
      type: "input",
      field: "postalCode",
    },
  },
  {
    label: "所属区域",
    prop: "region",
    operate: {
      type: "input",
      field: "region",
    },
  },
  {
    label: "仓库地址",
    prop: "warehouseAddress",
    width: 150,
    operate: {
      type: "input",
      field: "warehouseAddress",
    },
  },
  {
    label: "免仓日",
    prop: "freeStorageDay",
    width: 100,
    operate: {
      type: "inputNumber",
      field: "freeStorageDay",
    },
  },
  {
    label: "城市",
    prop: "city",
    operate: {
      type: "input",
      field: "city",
    },
  },
  {
    label: "仓租",
    prop: "storageFee",
    width: 100,
    operate: {
      type: "inputNumber",
      field: "storageFee",
    },
  },
  {
    label: "弃件日",
    prop: "discardDay",
    width: 100,
    operate: {
      type: "inputNumber",
      field: "discardDay",
    },
  },
  {
    label: "片假名",
    prop: "katakana",
    operate: {
      type: "input",
      field: "katakana",
    },
  },
  {
    label: "重量单位",
    prop: "weightUnit",
    operate: {
      type: "input",
      field: "weightUnit",
    },
  },
];
